import memberApi from "@/api/declaration/mall/memberApi"
import httpRequest from "@/config/axios/httpRequest"
import { MemberGroupModel } from "@/models/mall/MemberGroupModel"


// 查询用户分组列表
export const getGroupPage = async (params: any) => {
  return await httpRequest.get(memberApi.GetGroupPage, { params })
}

// 查询用户分组详情
export const getGroup = async (id: number) => {
  return await httpRequest.get(memberApi.GetGroup,{params:{id}})
}

// 新增用户分组
export const createGroup = async (data: MemberGroupModel) => {
  return await httpRequest.post(memberApi.CreateGroup,data)
}

// 查询用户分组 - 精简信息列表
export const getSimpleGroupList = async () => {
  return await httpRequest.get(memberApi.GetSimpleGroupList)
}

// 修改用户分组
export const updateGroup = async (data: MemberGroupModel) => {
  return await httpRequest.put(memberApi.UpdateGroup,data)
}

// 删除用户分组
export const deleteGroup = async (id: number) => {
  return await httpRequest.delete(memberApi.DeleteGroup,{params:{id}})
}
